package com.lzg.prototype.simple;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author lizhigang Date: 2019/4/22 14:03
 * @description:
 */
public class PrototypeTest {
	public static void main(String[] args) {
		//创建要克隆的对象
		ComputerA computerA = new ComputerA();
		computerA.setNo(11);
		computerA.setName("戴尔");
		computerA.setKeyWord("原装");
		System.out.println("装载后的要克隆的对象="+computerA);
		List<String> yanse1 = new ArrayList<String>();
		computerA.setYanse(yanse1);
		Client client = new Client(computerA);
		ComputerA computerA1 = (ComputerA) client.StartClonePrototype();
		System.out.println("clone before："+ computerA1);


		System.out.println(computerA1 == computerA);
		System.out.println(computerA.getYanse() == computerA1.getYanse());


	}

}
